<template>
    <div id="home-container" :class="bgType">
        <div class="drag-tool" style="-webkit-app-region: drag;-webkit-user-select: none;"></div>
        <div class="top-handle flex-around" style="-webkit-app-region: no-drag;">
            <span class="pointer" @click="$electron.ipcRenderer.send('resource-window-minimize',{metaId:metaId})">
                <i style="" class="el-icon-minus"></i>
            </span>
            <span class="pointer" @click="close">
                <i class="el-icon-close"></i>
            </span>
        </div>
        <slot></slot>
    </div>
</template>

<script>
export default {
    props: {
        metaId: String,
        bgType: {
            type: String,
            default: 'question-bg'
        }
    },
    methods: {
        close () {
            this.$emit('beforeClose')
            console.log(this.metaId)
            this.$electron.ipcRenderer.send('close-resource-window', { metaId: this.metaId })
        }
    }
}
</script>

<style lang="scss">
#home-container {
    height: 100vh;
    width: 100vw;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    background-position: center bottom;
    .top-handle {
        position: fixed;
        top: 25px;
        right: 10px;
        width: 70px;
        color: #fff;
        z-index: 100;
        font-size: 25px;
    }
    .drag-tool {
        width: 100vw;
        height: 150px;
        position: fixed;
        top: 0;
    }
}
.question-bg {
    width: 100vw;
    height: 100vh;
    background-image: url(../assets/img/tool-back-ground.png);
    // background-repeat: no-repeat;
    // background-size: cover;
}
.charts {
    background-image: url(../assets/img/charts-bg.png);
}
.tProgress {
    background-image: url(../assets/img/charts-bg.png);
}
</style>